// Copyright (C) 2005 Taylor L. Riché <riche@cs.utexas.edu>
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// 	$Id: NetInterface.hh 377 2006-02-08 02:20:14Z richetl $	
//

#ifndef NETINTERFACE_HH
#define NETINTERFACE_HH

#include <string>

#ifdef LEE_BUILD
#include "ApplicationGraph.hh"
#include "Synchronized.hh"
#include "Function.hh"
#else
#include <lee/ApplicationGraph.hh>
#include <lee/Synchronized.hh>
#include <lee/Function.hh>
#endif

namespace lee {

  static const std::string ETH0 = "eth0";
  static const std::string ETH1 = "eth1";
  static const std::string ETH2 = "eth2";
  static const std::string ETH3 = "eth3";

  class ApplicationGraph;
  class Scheduler;
  typedef void PktData;

  class NetInterface : public Function
  {
  protected:
    std::string intfName;
    ApplicationGraph * ag;
    Scheduler * scheduler;
    void waitForSetup();

  public:
    static const int IN = 0;
    static const int OUT = 1;
    static const int ETH0int = 0;
    static const int ETH1int = 1;
    static const int ETH2int = 2;
    static const int ETH3int = 3;
    
    NetInterface(std::string n) : Function(n, n), intfName(n), ag(NULL), scheduler(NULL)
    {}
    virtual ~NetInterface() {}
    void setAG(ApplicationGraph * a);
    void setSched(Scheduler * s);
    virtual void go() {}
    virtual void stop() {}
    virtual void process () {}
  };

}
#endif // NETINTERFACE_HH

